# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

exports_files([
    "README.md",
    "VERSION",
])

# This top-level target describes the entire set of targets that will be
# assembled into the CompilerGym pip package.
py_library(
    name = "CompilerGym",
    data = [
        "//compiler_gym/third_party/cbench:benchmarks_list",
        "//compiler_gym/third_party/cbench:crc32",
    ],
    deps = [
        "//compiler_gym",
        "//compiler_gym/bin",
        "//compiler_gym/datasets",
        "//compiler_gym/envs",
        "//compiler_gym/service",
        "//compiler_gym/service/runtime",
        "//compiler_gym/spaces",
        "//compiler_gym/util",
        "//compiler_gym/util/flags",
        "//compiler_gym/views",
    ],
)

# Create a fake binary target that depends on CompilerGym so that bazel creates
# the runfiles directory containing the dependent python code.
py_binary(
    name = "package",
    srcs = ["empty.py"],
    main = "empty.py",
    deps = [
        ":CompilerGym",
    ],
)

genrule(
    name = "make_empty_python_file",
    outs = ["empty.py"],
    cmd = "touch $@",
)
